/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliveryPackageFee;
import org.apache.ibatis.jdbc.SQL;

public class DeliveryPackageFeeSqlProvider {

    /* @mbggenerated */
    public String insertSelective(DeliveryPackageFee record) {
        return new SQL() {
            {
                INSERT_INTO("delivery_package_fee");

                if (record.getSendProvince() != null) {
                    VALUES("send_province", "#{sendProvince,jdbcType=VARCHAR}");
                }

                if (record.getSendCity() != null) {
                    VALUES("send_city", "#{sendCity,jdbcType=VARCHAR}");
                }

                if (record.getSendDistrict() != null) {
                    VALUES("send_district", "#{sendDistrict,jdbcType=VARCHAR}");
                }

                if (record.getReceiveProvince() != null) {
                    VALUES("receive_province", "#{receiveProvince,jdbcType=VARCHAR}");
                }

                if (record.getReceiveCity() != null) {
                    VALUES("receive_city", "#{receiveCity,jdbcType=VARCHAR}");
                }

                if (record.getReceiveDistrict() != null) {
                    VALUES("receive_district", "#{receiveDistrict,jdbcType=VARCHAR}");
                }

                if (record.getCostPrice() != null) {
                    VALUES("cost_price", "#{costPrice,jdbcType=INTEGER}");
                }

                if (record.getRetailPrice() != null) {
                    VALUES("retail_price", "#{retailPrice,jdbcType=INTEGER}");
                }

                if (record.getCreateTime() != null) {
                    VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
                }

                if (record.getUpdTime() != null) {
                    VALUES("upd_time", "#{updTime,jdbcType=TIMESTAMP}");
                }

                if (record.getCreateUserId() != null) {
                    VALUES("create_user_id", "#{createUserId,jdbcType=INTEGER}");
                }

                if (record.getUpdateUserId() != null) {
                    VALUES("update_user_id", "#{updateUserId,jdbcType=INTEGER}");
                }

                if (record.getState() != null) {
                    VALUES("state", "#{state,jdbcType=TINYINT}");
                }

                if (record.getWeight() != null) {
                    VALUES("weight", "#{weight,jdbcType=INTEGER}");
                }

            }
        }.toString();
    }

    /* @mbggenerated */
    public String updateByPrimaryKeySelective(DeliveryPackageFee record) {
        return new SQL() {
            {
                UPDATE("delivery_package_fee");

                if (record.getSendProvince() != null) {
                    SET("send_province = #{sendProvince,jdbcType=VARCHAR}");
                }

                if (record.getSendCity() != null) {
                    SET("send_city = #{sendCity,jdbcType=VARCHAR}");
                }

                if (record.getSendDistrict() != null) {
                    SET("send_district = #{sendDistrict,jdbcType=VARCHAR}");
                }

                if (record.getReceiveProvince() != null) {
                    SET("receive_province = #{receiveProvince,jdbcType=VARCHAR}");
                }

                if (record.getReceiveCity() != null) {
                    SET("receive_city = #{receiveCity,jdbcType=VARCHAR}");
                }

                if (record.getReceiveDistrict() != null) {
                    SET("receive_district = #{receiveDistrict,jdbcType=VARCHAR}");
                }

                if (record.getCostPrice() != null) {
                    SET("cost_price = #{costPrice,jdbcType=INTEGER}");
                }

                if (record.getRetailPrice() != null) {
                    SET("retail_price = #{retailPrice,jdbcType=INTEGER}");
                }

                if (record.getCreateTime() != null) {
                    SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
                }

                if (record.getUpdTime() != null) {
                    SET("upd_time = #{updTime,jdbcType=TIMESTAMP}");
                }

                if (record.getCreateUserId() != null) {
                    SET("create_user_id = #{createUserId,jdbcType=INTEGER}");
                }

                if (record.getUpdateUserId() != null) {
                    SET("update_user_id = #{updateUserId,jdbcType=INTEGER}");
                }

                if (record.getState() != null) {
                    SET("state = #{state,jdbcType=TINYINT}");
                }

                if (record.getWeight() != null) {
                    SET("weight = #{weight,jdbcType=INTEGER}");
                }

                WHERE("id = #{id,jdbcType=INTEGER}");

            }
        }.toString();
    }
}